<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>class类继承-3</title>
</head>

<body>
  <script>
    let father = {
      getName() {
        console.log("father")
      }
    };

    let child = {
      getName() {
        super.getName();
        // Object.getPrototypeOf(this).getName()
        // Object.getPrototypeOf(this).getName.call(this)
        console.log("child")
      }
    }

    Object.setPrototypeOf(child, father)
    child.getName() // 依次输出 father child

  </script>
</body>

</html>